// 封装所有后端接口调用
import axios from 'axios';

const API = axios.create({
    baseURL: process.env.REACT_APP_API_BASE || '/api'
});

export const userAPI = {
    getAll: () => API.get('/users'),
    create: (data) => API.post('/users', data),
    update: (id, data) => API.put(`/users/${id}`, data),
    delete: (id) => API.delete(`/users/${id}`)
};
export const systemAPI = {
    getAll: () => API.get('/systems'),
    create: (data) => API.post('/systems', data),
    update: (id, data) => API.put(`/systems/${id}`, data),
    delete: (id) => API.delete(`/systems/${id}`)
};
